@head-height: 48px; // 头部高度

// 菜单栏
@side-width: 200px; // 侧栏宽度
@side-bgc: white; // 侧栏背景色
@side-bgc-active: #15b194; // 选中背景色
@side-bgc-hover: #15b1948b; // 鼠标移入背景色
@side-text-color: black; // 侧栏字体颜色

// 页头
@head-bgc: #fff;

// 标签选项卡
@tab-height: 32px;
@tab-color-base: #15b194;
@tab-color-active: #ecf5ff;

.layout-wrap {
  width: 100%;
  height: 100%;
}

// 侧栏
.layout-side {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: @side-width;
  background-color: @side-bgc;
  transition: all 0.2s;
  z-index: 100;
  .layout-side-scrollbar {
    height: calc(100% - @head-height);
  }
}

// logo
.layout-logo {
  height: @head-height;
  display: flex;
  align-items: center;
  padding-left: 12px;
  .layout-logo-icon {
    width: 25px;
    height: 25px;
  }
  .layout-logo-title {
    font-size: 16px;
    font-weight: 700;
    color: black;
    margin-left: 12px;
    transition: all 0.2s;
    white-space: nowrap;
  }
}

// 菜单
.layout-menu-container {
  background-color: @side-bgc !important;
  border-right: none !important;
  a {
    color: black;
  }
  .menu-icon {
    width: auto !important;
    margin-right: 8px !important;
    font-size: 16px !important;
    .icon {
      margin: 0;
    }
  }

  // background-color="#001529"
  // text-color="#b3b9bf"
  // 重写element menu样式
  .el-menu-item,
  .el-sub-menu__title {
    color: black;
    height: @head-height;
    line-height: @head-height;
    &:hover {
      color: #fff !important;
      background-color: @side-bgc-hover !important;
    }
  }

  .el-sub-menu .el-menu-item {
    background-color: rgb(243, 234, 234);
  }

  .el-menu-item.is-active {
    color: @side-text-color;
  }
  .is-active>.el-sub-menu__title {
    color: black;
  }

  .router-link-active {
    .el-menu-item {
      color: #fff;
      background-color: @side-bgc-active !important;
    }
  }

  &.el-menu--collapse {
    width: 100%;
    .el-menu-item > div {
      padding: 0 !important;
      justify-content: center;
    }
    .el-sub-menu__title {
      padding: 0 !important;
      justify-content: center;
    }
    .el-sub-menu.is-active {
      .el-sub-menu__title {
        color: black;
      }
    }
  }
}

// 菜单弹框
.layout-menu-popper {
  .el-menu {
    background-color: #15b194 !important;
  }
  .el-menu-item,
  .el-sub-menu__title {
    color: @side-text-color;
    height: @head-height;
    line-height: @head-height;
    &:hover {
      color: #fff;
      background-color: @side-bgc-hover !important;
    }

    // &.is-active {
    //   color: #fff;
    //   background-color: @side-bgc-active !important;
    // }
  }
  .el-menu-item.is-active {
    color: @side-text-color;
    // color: #fff !important;
  }
  
  .router-link-active {
    .el-menu-item {
      color: #fff;
      background-color: @side-bgc-active !important;
    }
  }
}

// 内容头部
.layout-header {
  position: fixed;
  top: 0;
  left: @side-width;
  right: 0;
  background-color: @head-bgc;
  z-index: 99;
  height: @head-height;
  line-height: @head-height;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
  box-sizing: border-box;
  .layout-header-left {
    font-size: 0;
    height: 100%;
    display: flex;
    .layout-header-trigger {
      padding: 0 12px;
      cursor: pointer;
      user-select: none;
      color: #333;
      display: flex;
      align-items: center;
      height: @head-height;
      font-size: 18px;
      &:hover {
        // color: #606266;
        background-color: #f6f6f6;
      }
    }
    .layout-breadcrumb {
      display: flex;
      align-items: center;
      padding-left: 8px;
    }
  }
  .layout-header-right {
    display: flex;
  }

  .layout-header-user {
    padding: 0 12px;
  }
}

// 标签选项卡
.layout-tabs-wrap {
  position: fixed;
  top: @head-height;
  left: @side-width;
  right: 0;
  @tab-height: 32px;
  background-color: #fff;
  z-index: 99;
  transition: all 0.2s;

  /** 覆盖 element tabs 样式 **/
  .layout-tabs-content {
    .el-tabs__header {
      border-bottom: none;
      margin: 0;
      height: auto;
      .el-tabs__nav {
        border: none;
      }

      .el-tabs__item {
        height: @tab-height;
        line-height: @tab-height;
        padding: 0 12px !important;
        user-select: none;
        .tabContent {
          display: inline-block;
          line-height: @tab-height;
        }

        &.is-active {
          color: @tab-color-base;
          background-color: @tab-color-active;
          border-bottom: 1px solid @tab-color-base;
          border-radius: 2px;
          .tabContent {
            color: @tab-color-base;
          }
        }
      }

      .el-tabs__nav-prev,
      .el-tabs__nav-next {
        line-height: @tab-height + 2px;
      }
    }
  }
}

// 内容视图
.layout-main {
  width: 100%;
  min-height: 100vh;
  padding-top: @tab-height;
  padding-left: @side-width;
  background-color: #f0f2f5;
  display: flex;
  box-sizing: border-box;
  transition: all 0.2s;
  --el-color-primary: #15b194;
  .layout-container {
    flex: 1 1 auto;
    overflow: hidden;
    margin: 12px;
    position: relative;
    min-height: 0;
  }
}

.layout-tabs-wrap + .layout-main {
  padding-top: @head-height + @tab-height;
}

// 左边栏 折叠状态
.isMobile {
  .layout-header,
  .layout-tabs-wrap {
    left: 0;
  }
  .layout-main {
    padding-left: 0;
  }
}

.isCollapsed {
  .layout-side {
    width: @head-height;
  }
  .layout-header,
  .layout-tabs-wrap {
    left: @head-height;
  }
  .layout-main {
    padding-left: @head-height;
  }
}
